#include <stdio.h>

/**
 * 题目：有一分数序列：2/1，3/2，5/3，8/5，13/8，21/13...求出这个数列的前20项之和。
 * 程序分析：请抓住分子与分母的变化规律。
*/
int main(int argc, char const *argv[])
{
    float up, down, old_up;
    float sum = 0.0;
    int i = 1;

    while (i<=20)
    {
        if (i == 1)
        {
            up = 2;
            down = 1;
            
        } else
        {
            old_up = up;
            up += down;
            down = old_up;
        }

        sum = sum + up / down;
        printf("%.0f/%.0f", up, down);
        if (i<20)
        {
            printf("+");
        }
        i++;
    }
    printf(" = %9.6f\n", sum);

    return 0;
}